package com.qf.domain;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;

public class NewsDetail {
    private Integer id;
    @NotBlank(message = "新闻标题不能为空")
    private String title;//新闻标题
    private String summary;//新闻摘要
    private String author;//作者

    @NotNull(message = "新闻标题时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String creatcdate;

    public NewsDetail() {
    }

    public NewsDetail(Integer id, String title, String summary, String author, String creatcdate) {
        this.id = id;
        this.title = title;
        this.summary = summary;
        this.author = author;
        this.creatcdate = creatcdate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCreatcdate() {
        return creatcdate;
    }

    public void setCreatcdate(String creatcdate) {
        this.creatcdate = creatcdate;
    }

    @Override
    public String toString() {
        return "NewsDetail{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", summary='" + summary + '\'' +
                ", author='" + author + '\'' +
                ", creatcdate='" + creatcdate + '\'' +
                '}';
    }
}